package com.flyqiu.form.core.event;

import com.alibaba.fastjson2.JSONObject;
import com.flyqiu.form.api.event.FlyQiuTableDataEvent;
import com.flyqiu.form.common.FlyQiuFormConstant;
import com.flyqiu.form.model.entity.FlyQiuTableConfig;

import java.time.LocalDateTime;

public class GlobalFlyQiuTableDataEvent implements FlyQiuTableDataEvent {
    @Override
    public void beforeSaveData(FlyQiuTableConfig formConfig, JSONObject data) {
        data.put(FlyQiuFormConstant.FormBaseColumns.COLUMN_DELETE_FLAG, formConfig.getCreateBy());
        data.put(FlyQiuFormConstant.FormBaseColumns.COLUMN_CREATE_TIME, LocalDateTime.now());
    }
}
